package mathematics;


import java.util.ArrayList;

/**
 * @author 杜伟毅
 * @version 1.0
 * @since 2024/10/23
 */
public class Test {
    Fraction fraction = new Fraction();

    // 测试分数
    @org.junit.Test
    public void test() {
        String maxFraction = fraction.findMaxFraction(new Fraction(1, 3), new Fraction(2, 4));
        String add = fraction.add(new Fraction(9, 8), new Fraction(9, 8));
        String sub = fraction.sub(new Fraction(1, 1), new Fraction(2, 8));
        String multiply = fraction.multiply(45, new Fraction(2, 5));
        System.out.println("add = " + add);
        System.out.println("sub = " + sub);
        System.out.println("multiply = " + multiply);
        System.out.println(maxFraction);
    }

    // 测试维恩图
    @org.junit.Test
    public void test1() {
        ArrayList<String> jumpRopeList = new ArrayList<>();
        ArrayList<String> sprintList = new ArrayList<>();
        VennDiagram<String> stringVennDiagram = new VennDiagram<>();
        String[] jumpRope = {"杨明", "陈东", "刘红", "李芳", "王爱华", "马超", "赵军", "王鹏"};
        String[] sprint = {"刘红", "于利", "周晓", "李芳", "卢强", "赵军", "杨明", "王鹏"};

        for (String s : jumpRope) {
            jumpRopeList.add(s);
        }
        for (String s : sprint) {
            sprintList.add(s);
        }
        ArrayList<String> intersection = stringVennDiagram.getIntersection(jumpRopeList, sprintList);
        System.out.println("intersection = " + intersection);
    }

    // 测试方形计算
    @org.junit.Test
    public void test2(){
    }
}
